/* 
 * GrayRabbit Cms基于J2EE架构内容管理系统
 * Copyright © GrayRabbit Co., Ltd. All rights reserved.
 * Department：运营部
 * 更多信息，请visit:
 * http://code.google.com/p/gray-rabbit-cms/
 */
package org.grayrabbit.cms.dao.dictionary; 

import java.util.List;

import org.grayrabbit.cms.entity.Dictionary;
import org.grayrabbit.cms.vo.dictionary.DictionaryBean;

import org.grayrabbit.dao.GenericDao;
import org.grayrabbit.dao.util.Page;
import org.grayrabbit.dao.util.QueryCondition;

/**
 * <b>Dictionary</b>的DAO接口

 * @version 1.0,创建时间:2011-05-16 14:46:47 
 */
public interface DictionaryDao extends GenericDao<Dictionary, String>{
	
	/**
	 * 根据bean组装查询条件
	 */
	public QueryCondition assembly(DictionaryBean bean);
	/**
	 * 根据bean组装统计查询条件
	 */
	public QueryCondition assemblyCount(DictionaryBean bean);
	public int count(DictionaryBean bean);
	/**
	 * 根据bean组装查询条件(名称参数)
	 */
	public QueryCondition assermblyNameQuery(DictionaryBean bean);
	
	/**
	 * 根据bean组装统计查询条件(名称参数)
	 */
	public QueryCondition assemblyNameQueryCount(DictionaryBean bean);
	/**
	 * 填充分页组件
	 * @param page
	 * @param bean
	 */
	public List<Dictionary> findByPage(Page<Dictionary> page, DictionaryBean bean);
	/**
	 * 根据类型ID获取字典信息
	 * @param bean
	 * @return
	 */
	public List<Dictionary> findByDicTypeId(DictionaryBean bean);
	/**
	 * 根据字典ORDER排序获取所有信息
	 * @param bean
	 * @return
	 */
	public List<Dictionary> findAllByOrder();
	public List<Dictionary> findTopLevelDicByTypeId(String dicTypeId);
	public Dictionary findDicByCode(String key);
	public boolean findByParentId(String parentid);
	public void updateDictionary(Dictionary d2);
	
	/**
	 * 根据字典Value获取字典对象的Key
	 * @param dictionaryValue
	 * @return
	 */
	public String findByValue(String dictionaryValue);
	
}